﻿<table align="center" cellpadding="4" cellspacing="1" border="0" style="width:65%" class="tableinborder">
<tr>
<td width="5%" class="tabletitle" align="center"><strong>ID</strong></td>
<td width="35%" class="tabletitle" align="center"><strong>Threadname</strong></td>
<td width="10%" class="tabletitle" align="center"><strong>Von</strong></td>
<td width="10%" class="tabletitle" align="center"><strong>am</strong></td>
<td width="10%" class="tabletitle" align="center"><strong>Views</strong></td>
<td width="10%" class="tabletitle" align="center"><strong>Antworten</strong></td>
<td width="15%" class="tabletitle" align="center"><strong>Letzer Poster</strong></td>
<td width="5%" class="tabletitle" align="center"><strong>Melden</strong></td>
</tr>
<?php
$pathwbb = 'forum';  // Pfad zum wBB Ordner
$count    = 5;     //wie viele Posts anzeigen?

//DB-Verbindung
/* DEAKTIVIERT
$dbHost = "localhost";  // Adresse des Datenbankservers, fast immer localhost 
$dbUser = "";        // Ihr MySQL Benutzername 
$dbPassword = "";       // Ihr MySQL Passwort
$dbName = "";              // Name der Datenbank 
*/

require_once($pathwbb.'/wcf/config.inc.php');


$conn = mysql_connect($dbHost,$dbUser,$dbPassword);
mysql_select_db($dbName,$conn);
 
$result = mysql_query("SELECT * FROM wbb1_1_thread ORDER BY lastPostTime DESC LIMIT ".$count."",$conn);


while ($row = mysql_fetch_array($result)) {
    echo '<tr>
    <td valign="top" class="tablea" align="center">'.$row['threadID'].'</td>
    <td valign="top" class="tableb" align="center">
    <a href="'.$pathwbb.'/index.php?page=Thread&amp;threadID='.$row['threadID'].'" title="'.$row['firstPostPreview'].'">
    <strong>'.$row['prefix'].'</strong> '.$row['topic'].'</a>
    </td>
    <td valign="top" class="tablea" align="center">
    <a href='.$pathwbb.'/index.php?page=User&amp;userID='.$row['userID'].'>'.$row['username'].'</a>
    </td>
    <td valign="top" class="tableb" align="center">'.date("d.m.Y",$row['time']).'</td>
    <td valign="top" class="tablea" align="center">'.$row['views'].'</td>
    <td valign="top" class="tableb" align="center">'.$row['replies'].'</td>
    <td valign="top" class="tablea" align="center">'.$row['lastPoster'].'</td>
    <td valign="top" class="tablea" align="center"><font color="red"><a class="melden" href='.$pathwbb.'/index.php?form=PostReport&postID='.$row['firstPostID'].'>X</a></font></td>
    </tr>';
}
mysql_free_result($result);
?>
</table>